package jin.si.com.web;

import jin.si.com.entity.ResourcesEntity;
import jin.si.com.entity.User;
import jin.si.com.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 测试
 * @ClassName TestController
 * @Author MT
 * @Date 2021/5/7 10:15
 **/



@RestController
@RequestMapping("/find")
@PropertySource({"classpath:resource.properties"})
public class TestController {

    @Value("${path1}")
    private String path;

    @RequestMapping("getPath")
    public JsonData getPath(){
        return JsonData.buildSuccess(path);
    }

    //对象注入
    @Autowired
    private ResourcesEntity entity;

    @RequestMapping("getPath2")
    public JsonData getPath2(){
        ResourcesEntity r=new ResourcesEntity();

        String code = entity.getCode();
        return JsonData.buildSuccess(r.getCode());
    }









}
